package com.hardy.tree;

import java.util.LinkedList;

/**
 * Author: fuxh3@lenovo.com
 * Date: Created in 2017/12/7 0007
 * 字典树的节点
 */
public class TrieNode {
    char content; //单词
    boolean isEnd;// 是否单词结尾
    int count;
    LinkedList<TrieNode> childList;
    public TrieNode(char c){
        childList = new LinkedList<TrieNode>();
        isEnd = false;
        content = c;
        count = 0;
    }
    public TrieNode subNode(char c){
        if(childList!=null){
            for (TrieNode eachChild : childList){
                if(eachChild.content==c){
                    return eachChild;
                }
            }
        }
        return  null;
    }
}
